3.324 \(\int (a+b \sec ^2(e+f x))^2 \tan ^5(e+f x) \, dx\)

Optimal. Leaf size=100 \[ \frac{\left (a^2-4 a b+b^2\right ) \sec ^4(e+f x)}{4 f}-\frac{a^2 \log (\cos (e+f x))}{f}+\frac{b (a-b) \sec ^6(e+f x)}{3 f}-\frac{a (a-b) \sec ^2(e+f x)}{f}+\frac{b^2 \sec ^8(e+f x)}{8 f} \]

[Out]

-((a^2*Log[Cos[e + f*x]])/f) - (a*(a - b)*Sec[e + f*x]^2)/f + ((a^2 - 4*a*b + b^2)*Sec[e + f*x]^4)/(4*f) + ((a
 - b)*b*Sec[e + f*x]^6)/(3*f) + (b^2*Sec[e + f*x]^8)/(8*f)

________________________________________________________________________________________

Rubi [A]  time = 0.10066, antiderivative size = 100, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4138, 446, 88} \[ \frac{\left (a^2-4 a b+b^2\right ) \sec ^4(e+f x)}{4 f}-\frac{a^2 \log (\cos (e+f x))}{f}+\frac{b (a-b) \sec ^6(e+f x)}{3 f}-\frac{a (a-b) \sec ^2(e+f x)}{f}+\frac{b^2 \sec ^8(e+f x)}{8 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)^2*Tan[e + f*x]^5,x]

[Out]

-((a^2*Log[Cos[e + f*x]])/f) - (a*(a - b)*Sec[e + f*x]^2)/f + ((a^2 - 4*a*b + b^2)*Sec[e + f*x]^4)/(4*f) + ((a
 - b)*b*Sec[e + f*x]^6)/(3*f) + (b^2*Sec[e + f*x]^8)/(8*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin{align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^5(e+f x) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^2 \left (b+a x^2\right )^2}{x^9} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(1-x)^2 (b+a x)^2}{x^5} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{b^2}{x^5}+\frac{2 (a-b) b}{x^4}+\frac{a^2-4 a b+b^2}{x^3}-\frac{2 a (a-b)}{x^2}+\frac{a^2}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{a^2 \log (\cos (e+f x))}{f}-\frac{a (a-b) \sec ^2(e+f x)}{f}+\frac{\left (a^2-4 a b+b^2\right ) \sec ^4(e+f x)}{4 f}+\frac{(a-b) b \sec ^6(e+f x)}{3 f}+\frac{b^2 \sec ^8(e+f x)}{8 f}\\ \end{align*}

Mathematica [A]  time = 0.48123, size = 126, normalized size = 1.26 \[ -\frac{\cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \left (-6 \left (a^2-4 a b+b^2\right ) \sec ^4(e+f x)+24 a^2 \log (\cos (e+f x))-8 b (a-b) \sec ^6(e+f x)+24 a (a-b) \sec ^2(e+f x)-3 b^2 \sec ^8(e+f x)\right )}{6 f (a \cos (2 e+2 f x)+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)^2*Tan[e + f*x]^5,x]

[Out]

-(Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2*(24*a^2*Log[Cos[e + f*x]] + 24*a*(a - b)*Sec[e + f*x]^2 - 6*(a^2 - 4
*a*b + b^2)*Sec[e + f*x]^4 - 8*(a - b)*b*Sec[e + f*x]^6 - 3*b^2*Sec[e + f*x]^8))/(6*f*(a + 2*b + a*Cos[2*e + 2
*f*x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.061, size = 120, normalized size = 1.2 \begin{align*}{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{4}{a}^{2}}{4\,f}}-{\frac{{a}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,f}}-{\frac{{a}^{2}\ln \left ( \cos \left ( fx+e \right ) \right ) }{f}}+{\frac{ab \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{3\,f \left ( \cos \left ( fx+e \right ) \right ) ^{6}}}+{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{8\,f \left ( \cos \left ( fx+e \right ) \right ) ^{8}}}+{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{24\,f \left ( \cos \left ( fx+e \right ) \right ) ^{6}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^5,x)

[Out]

1/4/f*tan(f*x+e)^4*a^2-1/2/f*a^2*tan(f*x+e)^2-a^2*ln(cos(f*x+e))/f+1/3/f*a*b*sin(f*x+e)^6/cos(f*x+e)^6+1/8/f*b
^2*sin(f*x+e)^6/cos(f*x+e)^8+1/24/f*b^2*sin(f*x+e)^6/cos(f*x+e)^6

________________________________________________________________________________________

Maxima [A]  time = 1.05593, size = 198, normalized size = 1.98 \begin{align*} -\frac{12 \, a^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac{24 \,{\left (a^{2} - a b\right )} \sin \left (f x + e\right )^{6} - 6 \,{\left (11 \, a^{2} - 8 \, a b - b^{2}\right )} \sin \left (f x + e\right )^{4} + 4 \,{\left (15 \, a^{2} - 8 \, a b - b^{2}\right )} \sin \left (f x + e\right )^{2} - 18 \, a^{2} + 8 \, a b + b^{2}}{\sin \left (f x + e\right )^{8} - 4 \, \sin \left (f x + e\right )^{6} + 6 \, \sin \left (f x + e\right )^{4} - 4 \, \sin \left (f x + e\right )^{2} + 1}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^5,x, algorithm="maxima")

[Out]

-1/24*(12*a^2*log(sin(f*x + e)^2 - 1) - (24*(a^2 - a*b)*sin(f*x + e)^6 - 6*(11*a^2 - 8*a*b - b^2)*sin(f*x + e)
^4 + 4*(15*a^2 - 8*a*b - b^2)*sin(f*x + e)^2 - 18*a^2 + 8*a*b + b^2)/(sin(f*x + e)^8 - 4*sin(f*x + e)^6 + 6*si
n(f*x + e)^4 - 4*sin(f*x + e)^2 + 1))/f

________________________________________________________________________________________

Fricas [A]  time = 0.560644, size = 242, normalized size = 2.42 \begin{align*} -\frac{24 \, a^{2} \cos \left (f x + e\right )^{8} \log \left (-\cos \left (f x + e\right )\right ) + 24 \,{\left (a^{2} - a b\right )} \cos \left (f x + e\right )^{6} - 6 \,{\left (a^{2} - 4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 8 \,{\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 3 \, b^{2}}{24 \, f \cos \left (f x + e\right )^{8}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^5,x, algorithm="fricas")

[Out]

-1/24*(24*a^2*cos(f*x + e)^8*log(-cos(f*x + e)) + 24*(a^2 - a*b)*cos(f*x + e)^6 - 6*(a^2 - 4*a*b + b^2)*cos(f*
x + e)^4 - 8*(a*b - b^2)*cos(f*x + e)^2 - 3*b^2)/(f*cos(f*x + e)^8)

________________________________________________________________________________________

Sympy [A]  time = 21.8335, size = 190, normalized size = 1.9 \begin{align*} \begin{cases} \frac{a^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac{a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac{a b \tan ^{4}{\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{3 f} - \frac{a b \tan ^{2}{\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{3 f} + \frac{a b \sec ^{2}{\left (e + f x \right )}}{3 f} + \frac{b^{2} \tan ^{4}{\left (e + f x \right )} \sec ^{4}{\left (e + f x \right )}}{8 f} - \frac{b^{2} \tan ^{2}{\left (e + f x \right )} \sec ^{4}{\left (e + f x \right )}}{12 f} + \frac{b^{2} \sec ^{4}{\left (e + f x \right )}}{24 f} & \text{for}\: f \neq 0 \\x \left (a + b \sec ^{2}{\left (e \right )}\right )^{2} \tan ^{5}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)**2*tan(f*x+e)**5,x)

[Out]

Piecewise((a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**4/(4*f) - a**2*tan(e + f*x)**2/(2*f) + a*b
*tan(e + f*x)**4*sec(e + f*x)**2/(3*f) - a*b*tan(e + f*x)**2*sec(e + f*x)**2/(3*f) + a*b*sec(e + f*x)**2/(3*f)
 + b**2*tan(e + f*x)**4*sec(e + f*x)**4/(8*f) - b**2*tan(e + f*x)**2*sec(e + f*x)**4/(12*f) + b**2*sec(e + f*x
)**4/(24*f), Ne(f, 0)), (x*(a + b*sec(e)**2)**2*tan(e)**5, True))

________________________________________________________________________________________

Giac [B]  time = 3.19647, size = 628, normalized size = 6.28 \begin{align*} \frac{12 \, a^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right ) - 12 \, a^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right ) + \frac{25 \, a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{4} + 248 \, a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{3} + 984 \, a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{2} + 1760 \, a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 512 \, a b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 256 \, b^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 1168 \, a^{2} - 1024 \, a b + 256 \, b^{2}}{{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}^{4}}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*tan(f*x+e)^5,x, algorithm="giac")

[Out]

1/24*(12*a^2*log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2) - 12*a^2*
log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2) + (25*a^2*((cos(f*x +
e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1))^4 + 248*a^2*((cos(f*x + e) + 1)/(cos(f*x +
 e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1))^3 + 984*a^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*
x + e) - 1)/(cos(f*x + e) + 1))^2 + 1760*a^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(
f*x + e) + 1)) - 512*a*b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - 256
*b^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 1168*a^2 - 1024*a*b + 2
56*b^2)/((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2)^4)/f